package struct;

/**
 *
 * @author Gabrielle DuBois
 */
public class Address extends DBObject{
    private String street;
    private String city;
    private String state;
    private String zip;
    private String munic;
    private boolean current;
    private String notes;

    /**
     * Constructor
     * @param streetAddress
     * @param cityName
     * @param stateName
     * @param zipcode
     * @param municipal
     * @param isCurrentMailingAddress
     * @param additionalNotes
     */
    public Address(String streetAddress, String cityName,
                        String stateName, String zipcode, String municipal,
                        boolean isCurrentMailingAddress, String additionalNotes){
        super(7,2);
        attributes = new Object[numAttributes];
        attributes[0] = street = streetAddress;
        attributes[1] = city = cityName;
        attributes[2] = state = stateName;
        attributes[3] = zip = zipcode;
        attributes[4] = munic = municipal;
        attributes[5] = current = isCurrentMailingAddress;
        attributes[6] = notes = additionalNotes;

    }//constructor

    /**
     * @see struct.DBObject
     * @return an Object array containing all the attributes that make up an
     *          address in the following order: streetAddress(String),
     *          cityName(String), stateName(String), zipcode(String),
     *          municipal(String), isCurrentMailingAddress(Boolean),
     *          additionalNotes(String)
     */
    public Object[] getAttributes(){
        return attributes;
    }

    /**
     *
     * @return a String containing...
     */
    public String getCityName(){
        return city;
    }

    /**
     *
     * @return a String containing...
     */
    public String getStateName(){
        return state;
    }

    /**
     *
     * @return a String containing...
     */
    public String getMunicipal(){
        return munic;
    }
    
    /**
     *
     * @return a boolean containing...
     */
    public boolean getIsCurrentMailingAddress(){
        return current;
    }

    /**
     *
     * @return a String containing...
     */
    public String getAdditionalNotes(){
        return notes;
    }

    /**
     *
     * @return a String containing the street
     */
    public String getStreet(){
        return street;
    }

    /**
     *
     * @return a String containing the zipcode
     */
    public String getZipcode(){
        return zip;
    }

    /**
     * @see struct.DBObject
     * @return A String array containing the familyName in position 0
     *          and primaryPhoneNumber in position 1
     */
    public String[] getKey(){
        String[] key = new String[numInPrimaryKey];
        key[0] = street;
        key[1] = zip;

        return key;
    }//getKey()

}//Address
